package com.zust.java.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zust.java.bean.JobShop;
import com.zust.java.bean.Order;
import com.zust.java.dao.imp.OrderDaoImp;

@Service
public class InteractiveService {
    
    @Autowired
    private Order order;
    @Autowired
    private OrderDaoImp odi;
    @Autowired
    private JobShop jobShop;
    
    public boolean orderAddJobshop(int jobShopId, int orderNo) {
        jobShop.setId(jobShopId);
        order.setJobShop(jobShop);
        order.setOrderNo(orderNo);
        return odi.updateOrderJobShop(order);
    }
    
    public boolean orderDeleteJobShop(int orderNo) {
        jobShop.setId(0);
        order.setJobShop(jobShop);
        order.setOrderNo(orderNo);
        return odi.updateOrderJobShop(order);
    }
}
